all: TraceToRoot

CC		= g++
INCPATH         = -Iinclude -I$(ROOTSYS)/include
ROOTCFLAGS	= $(shell root-config --cflags)
ROOTLIBS	= $(shell root-config --libs)
#ROOTGLIBS	= $(shell root-config --glibs)

CFLAGS          = -Wall -c -g
CFLAGS          += $(ROOTCFLAGS)
LIBS            = -lm -L/usr/lib/libstdc++ $(ROOTLIBS)

OBJECTS	        = TraceToRoot.o HeaderParameters.o RawData.o Analysis.o

all: TraceToRoot

TraceToRoot: ${OBJECTS} Makefile
	$(CC) -o TraceToRoot $(OBJECTS) $(LIBS)

TraceToRoot.o: TraceToRoot.cc 
	$(CC) -c ${CFLAGS} ${INCPATH} TraceToRoot.cc -o TraceToRoot.o
HeaderParameters.o: src/HeaderParameters.cc
	$(CC) -c ${CFLAGS} ${INCPATH} src/HeaderParameters.cc -o HeaderParameters.o
RawData.o: src/RawData.cc
	$(CC) -c ${CFLAGS} ${INCPATH} src/RawData.cc -o RawData.o
Analysis.o: src/Analysis.cc
	$(CC) -c ${CFLAGS} ${INCPATH} src/Analysis.cc -o Analysis.o

#%.o: $(SRCDIR)%.cc Makefile
#	   $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 

clean:
	rm -rf *.o TraceToRoot
